package com.xbongbong.paas.service.stage.config;

import com.xbongbong.paas.service.stage.StageJumpHandle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Map;
import java.util.stream.Collectors;

/**
 * @Auther: yingjianfeng
 * @Date: 2021/12/3 11:15
 * @Description:
 */
@Configuration
public class StageJumpHandleConfig {
    @Autowired
    private Map<String, StageJumpHandle> stageJumpMap;

    @Bean("stageJumpMap")
    public Map<Integer, StageJumpHandle> initStageJump() {
        return stageJumpMap.values().stream().collect(Collectors.toMap(StageJumpHandle::type, t -> t));
    }
}
